From d2ae6f7e7aef2682bdb6f5af9295898d9209339c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 5 Jun 1993 20:58:47 +0000 Subject: [PATCH] (scroll-bar-drag-1): Calculate position relative to the accessible part of the buffer. --- lisp/scroll-bar.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index cddce3e419c..fa7e4a6d3ec 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -103,7 +103,10 @@ EVENT should be a scroll bar click or drag event." (portion-whole (nth 2 start-position))) (save-excursion (set-buffer (window-buffer window)) - (goto-char (scroll-bar-scale portion-whole (buffer-size))) + ;; Calculate position relative to the accessible part of the buffer. + (goto-char (+ (point-min) + (scroll-bar-scale portion-whole + (- (point-max) (point-min))))) (beginning-of-line) (set-window-start window (point))))) -- 2.30.2